
KC8 comboBox API
================


Functions:
==========

setItems(items, multiple, textFormat, html)
-------------------------------------------
Items

Array if items.
Each item has to be an object containing label, value and selected (optional).

Multiple

Boolean value indicating if multiple selections are allowed

TextFormat

TextFormat to be used. You can use this to set the font and font size.
Font size freedom is limited because the height of a collapsed combo is always the same. If you specify a large value, you will see only part of the text.

example:

myTF = new TextFormat();
myTF.font = 'Arial';
myTF.size = 12;

items = new Array();
items.push({label:'line 1',value:1});
items.push({label:'line 2',value:2});
items.push({label:'line 3',value:3,selected:true});
items.push({label:'line 4',value:4});
items.push({label:'line 5',value:5});

myCombo.setItems(items,false,myTF);

Html

When set to true, you can use html code inside the text of labels.



setSelected(index / [indices])
------------------------------
Set the selected item to the specified index / [indices].
If multiple selection is allowed, all other selected values are cleared.


getSelectedItems()
------------------
Returns an array of selected items.


getValues()
-----------
Function to be used when multiple selection is allowed.
Returns an array of values of the selected items.


getValue()
----------
Function to be used when multiple selection isn't allowed.
Returns the value of the selected item.



Properties:
===========

autoHide
--------
When set to true, a scrollbar is only used if necessary.

Note:
- This can only be set when setting up the component or just before setting new items



embedFonts
----------
Analog to textfield.embedFonts



Events:
=======

onChange( value )
-----------------
Event occuring when another item is selected.
If multiple selection is allowed, nothing is passed otherwise the value of the selected item is passed making it unnecessary to use the getValue function.
